package jaux.tank.service.system;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import org.springframework.core.io.Resource;

import jaux.tank.bean.entity.system.Attachment;
import jaux.tank.bean.entity.system.AttachmentBase;

public interface AttachmentService {

	List<AttachmentBase> listAttachments();

	Attachment save(Attachment attachment, File attachmentFile) throws IOException;

	Attachment getAttachmentById(String attachmentId);

	/**
	 * @param attachmentId
	 */
	AttachmentBase getAttachmentBaseById(String attachmentId);
	
	void deleteAttachment(String attachmentId);

	Attachment updateAttachmentWithoutContent(Attachment attachment);
	
	Attachment updateAttachment(Attachment attachment, File attachmentFile) throws IOException;
	
	public byte[] getAttachmentContent(String attachmentId) throws IOException;
	
	public InputStream getAttachmentStream(String attachmentId) throws IOException;
	
	public Resource getAttachmentResource(String attachmentId) throws IOException;

}
